<template>
  <div id="app">
    <h1>项目实战code5</h1>
    <p>请选择你喜欢的专栏</p>
    <div v-for="(item,index) in arr" :key="index" class="box">
      <input type="checkbox" v-model="val" value= item>
      <span>{{item}}</span>
    </div>
    <ul>
      <li v-for="(it,i) in val" :key="i">{{it}}</li>
    </ul>
  </div>
</template>

<script>
export default{
  data(){
    return{
      arr:['科幻','喜剧','动漫','冒险','科技','军事','娱乐','奇闻'],
      val:[],
    }
  }
}
</script>


<style scoped>
  .box{
    display: inline-block;
  }
</style>
